package com.my.radio;

import com.my.radio.R;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AbsListView;
import android.widget.TextView;

public class FrequencyView {
	private int mID;
	private String mFrequency = "--";
	private String mCurrent_band;
	private String mCurrent_frequency_unit = "MHz";

	private String mPTY_name;
	public static byte mSelected_ID = 1;

	public FrequencyView(Context context, int id) {
		mID = id;
	
		//if (RadioActivity.mThis != null) //to do more better . 
		LayoutInflater inflater = RadioActivity.mThis.getLayoutInflater();
		mView = inflater.inflate(R.layout.tl_list_radio, null, false);

	}
	public void setPTYName(String name) {
		mPTY_name = name;
	}
	public String getMFrequency() {
		return mFrequency;
	}

	public void setMFrequency(String mfrequency) {
		this.mFrequency = mfrequency;
	}

	public String getCurrent_band() {
		return mCurrent_band;
	}

	public void setCurrent_band(String current_band) {
		this.mCurrent_band = current_band;
	}

	public String getCurrent_frequency_unit() {
		return mCurrent_frequency_unit;
	}

	public void setCurrent_frequency_unit(String current_frequency_unit) {
		this.mCurrent_frequency_unit = current_frequency_unit;
	}

	public int getmID() {
		return mID;
	}

	private void setmID(int mID) {
		this.mID = mID;
	}

	// ///////
	private View mView;

	public View getView() {
		if (mView == null)
			return null;

		TextView tv1 = (TextView) mView.findViewById(R.id.list_text1);
		TextView tv2 = (TextView) mView.findViewById(R.id.list_text2);
		TextView tv3 = (TextView) mView.findViewById(R.id.list_text3);
		tv1.setVisibility(View.INVISIBLE);
		tv1.setText(mID + "");

//		if (mCurrent_band.equals("FM")) {
//			tv3.setText("");
//		} else {
			tv2.setText(mFrequency);
			tv3.setText(mCurrent_frequency_unit);
	//	}

		return mView;
	}
}
